package com.example.project.controller;

import com.example.project.pojo.Teacher;
import com.example.project.service.TeacherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;
import java.util.List;

@RestController
public class TeacherController {

    @Autowired
    TeacherService teacherService;

    @RequestMapping("/search_teacher")
    public String teacher(HttpSession session){
        List<Teacher> teacherLostAll = teacherService.GetTeacherAll();
        session.setAttribute("teacherLostAll",teacherLostAll);
        return teacherLostAll.toString();
    }
}
